<?php

class OOWP_Element_Html
    extends OOWP_Element
{

    public function __construct(array $args = array( ))
    {
        $input = $this->merge_arguments(array(
            'attributes' => array( ),
            'contents' => array( ),
            'container_decorator' => null,
            'contents_decorator' => null,
            'indent' => null,
            'void' => false,
            'tag' => 'html',
        ), $args);

        parent::__construct($input);
    }

    protected function filter_format_pieces($pieces)
    {
        array_unshift($pieces, '<!DOCTYPE html>');
        return $pieces;
    }

    protected function filter_element_start_tag_nucleus($pieces)
    {
        $pieces[ ] = 'xmlns="http://www.w3.org/1999/xhtml"';

        ob_start();
        language_attributes( );
        $pieces[ ] = ob_get_contents();
        ob_end_clean();

        return $pieces;
    }

}
